<?php
class People extends CI_Model {

    var $id = '';
    var $name = '';
    var $price    = '';
    var $category ='';

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
		$db = $this->load->database();
    }
    
    /**
     *
     * @param type $page, is an <code>int</code> that contains the
     *        page number we are currently in.
     * @return type 
     */
    function get_paintings($page)
    {
        $query = $this->db->query('select * from people order by position limit '.(((($page-1)*6))).' , 6');
        return $query->result();
    }
    function get_total_number_of_paintings()
    {
        $query = $this->db->query('select count(*) as count from people');
        return $query->result();
    }
}
?>